struct ListNode *detectCycle(struct ListNode *head) {
    struct ListNode *slow=head;
    struct ListNode *fast=head;

    while(fast&&fast->next)
    {
        slow=slow->next;
        fast=fast->next->next;
        if(slow==fast)//找相遇点
       {
           struct ListNode* meet=slow;//相遇点
           while(meet!=head)
           {
               head=head->next;
               meet=meet->next;
           }
                return meet;
       }
    }
    return NULL;
}